﻿{% extends "gma/base.html" %}
{% load static %}

<!-- CONTENT
  =====================================================================-->

{% block content %}

<div class="page__hd">
    <h1 class="page__title"> <i class="fa fa-gift my-page-title-icon"> </i> </h1>
    <p class="page__desc"> 礼物分类管理 </p>
</div>

<div class="page__bd">
    <div class="weui-panel weui-panel_access">
        <div class="weui-panel__hd">礼物分类列表</div>

        <div class="weui-panel__bd">
            <div class="weui-media-box weui-media-box_small-appmsg">
                <div class="weui-cells">
                    <a v-for="category in categories" class="weui-cell weui-cell_access weui-cell_example" :href="category.edit_url">
                        <div class="weui-cell__bd weui-cell_primary">
                            <p>[[ category.orderno ]]. [[ category.category_name ]]</p>
                        </div>
                        <div class="weui-cell__ft">
                        <label class="weui-switch-cp">
                            <input class="weui-switch-cp__input" v-model="category.enabled" type="checkbox" @click="clickGiftCategory(category)" />
                            <div class="weui-switch-cp__box"> </div>
                        </label>
                        </div>
                    </a>
                </div>
            </div>
        </div>

        <div class="weui-panel__ft">
            <a href="{% url 'gma:config_new_gift_category' %}" class="weui-cell weui-cell_access weui-cell_link">
                <div class="weui-cell__bd"><i class="fa fa-plus-square"></i> 增加新的礼物分类 </div>
                <span class="weui-cell__ft"></span>
            </a>
        </div>
    </div>
</div>

<div class="page__ft">
    <a href="{% url 'gma:home' %}">
        <span class="bottom-logo">
           HiBao
       </span>
    </a>
</div>

{% endblock content %}

<!-- SCRIPT
  =====================================================================-->

{% block extra_js %}

<script> {% include 'gma/config/gift/config_gift_category_list.vue' %} </script>

{% endblock extra_js %}